package com.suixinsanren.design.state.demo.demo01;

import org.junit.After;
import org.junit.Test;

public class GumballMachineTestDrive {

    private GumballMachine gumballMachine;

    @Test
    public void testDemo01() {
        gumballMachine = new GumballMachine(2);
        gumballMachine.insertQuarter();
    }

    @Test
    public void testDemo02() {
        gumballMachine = new GumballMachine(0);
        gumballMachine.insertQuarter();
    }

    @Test
    public void testDemo03() {
        gumballMachine = new GumballMachine(2);
        gumballMachine.insertQuarter();
        gumballMachine.ejectQuarter();
        gumballMachine.ejectQuarter();
        gumballMachine.turnCrank();
        gumballMachine.insertQuarter();
        gumballMachine.turnCrank();
    }

    @Test
    public void testDemo04() {
        gumballMachine = new GumballMachine(2);
        gumballMachine.insertQuarter();
        gumballMachine.turnCrank();
        gumballMachine.turnCrank();
    }

    @After
    public void after() {
        System.out.println("-----------");
    }
}
